#define DIM 2

class RegularRectangleMesh
{
private:
    double origin[DIM];
    double far_corner[DIM];
    int n_seg[DIM];
public:
    RegularRectangleMesh(const double* _ori,
			 const double* _far,
			 const int* _seg,);
    long n_grids() const;
};

RegularRectangleMesh::RegularRectangleMesh(const double* _ori,
					   const double* _far,
					   const int* _seg,)
{
    for (int i = 0; i < DIM; i++)
    {
	origin[i] = _ori;
	far_corner[i] = _far;
	n_seg[i] = _seg[i];
    }    
};

long RegularRectangleMesh::n_grids() const
{
    long n_ele = 1;
    for (int i = 0; i < DIM; i++)
	n_ele *= n_seg[i];
    return n_ele;
};
